package logic

import (
	"context"

	"2106A-zg6/baidu/srv/internal/svc"
	"2106A-zg6/baidu/srv/models"
	"2106A-zg6/baidu/srv/pb/baidu"

	"github.com/zeromicro/go-zero/core/logx"
)

type VipStoreLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewVipStoreLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VipStoreLogic {
	return &VipStoreLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *VipStoreLogic) VipStore(in *baidu.VipStoreRequest) (*baidu.VipStoreResponse, error) {

	store, err := models.CheckVipStore(in.VipId)
	if err != nil {
		return nil, err
	}

	return &baidu.VipStoreResponse{
		Store: store,
	}, nil
}
